import http from '@/utils/http'
// 全部运营商列表
export const getMerchants = (params) => {
  const url = `/user-management/merchant-management/merchants`
  return http.get(url, params)
}
// 分页搜索用户
export const userList = (params) => {
  const url = '/user-management/user-management/selectUserPage'
  return http.post(url, params)
}

// 查看用户套餐详情
export const userDetail = (params) => {
  const url = '/user-management/user-management/card-detail/selectCardDetail'
  return http.post(url, params)
}

// 分页搜索商户
export const merchantList = (params) => {
  const url = '/user-management/merchant-management/selectMerchantPage'
  return http.post(url, params)
}

// 分页搜索员工
export const staffList = (params) => {
  const url = '/user-management/staff-management/findStaff'
  return http.post(url, params)
}

// 分页搜索分账人
export const fzPersonList = (params) => {
  const url = '/user-management/partner-management/selectMerchantPartnerPage'
  return http.post(url, params)
}

// 分页搜索账号
export const accountList = (params) => {
  const url = '/user-management/system-user-management/pageSystemUser'
  return http.post(url, params)
}

// 添加账号
export const addAccount = (params) => {
  const url = '/user-management/system-user-management/addSystemUser'
  return http.post(url, params)
}

// 编辑账号
export const editAccount = (params) => {
  const url = '/user-management/system-user-management/updateSystemUser'
  return http.post(url, params)
}

// 更新账号状态
export const updateAccount = (params) => {
  const url = '/user-management/system-user-management/updateStatus'
  return http.post(url, params)
}

// 删除账号
export const deleteAccount = (params) => {
  const url = '/user-management/system-user-management/deleteSystemUser'
  return http.post(url, params)
}

// 新增代理商
export const addMerchants = (params) => {
  const url = '/user-management/merchant-management/insertNewMerchant'
  return http.post(url, params)
}

// 下级商户申请
export const subMerchantApply = (params) => {
  const url = '/user-management/merchant-management/subMerchantApply'
  return http.post(url, params)
}

// 完善个人信息申请
export const completeApply = (params) => {
  const url =
    '/user-management/merchant-management/merchantDetail/completeApply'
  return http.post(url, params)
}

// 查询单个代理商详情
export const queryMerchant = (params) => {
  const url =
    '/user-management/merchant-management/merchantDetail/getMerchantDetails'
  return http.post(url, params)
}

// 分页搜索申请
export const selectApply = (params) => {
  const url = '/user-management/verify-management/selectApplyPage'
  return http.post(url, params)
}

// 搜索申请详情
export const selectApplyDetail = (params) => {
  const url =
    '/user-management/verify-management/applyDetail-management/selectApplyDetail'
  return http.post(url, params)
}

// 删除商户申请
export const deleteApply = (params) => {
  const url = '/user-management/verify-management/delApplyMerchant'
  return http.post(url, params)
}

// 审核商户申请
export const approvalApply = (params) => {
  const url =
    '/user-management/verify-management/applyDetail-management/approvalApplyMerchant'
  return http.post(url, params)
}

// 修改支付信息
export const updateMerchantPayment = (params) => {
  const url =
    '/user-management/merchant-management/merchantDetail/updateMerchantPayment'
  return http.post(url, params)
}

// 删除商户
export const removeMerchant = (params) => {
  const url =
    '/user-management/merchant-management/merchantDetail/removeMerchant'
  return http.post(url, params)
}

// 更新商户
export const updateMerchant = (params) => {
  const url =
    '/user-management/merchant-management/merchantDetail/updateMerchant'
  return http.post(url, params)
}

// 重置密码
export const resetMerchantPassword = (params) => {
  const url =
    '/user-management/merchant-management/merchantDetail/resetMerchantPassword'
  return http.post(url, params)
}

// 查询可配置的员工角色
export const listStaffRoles = (params) => {
  const url = '/user-management/staff-management/listStaffRoles'
  return http.post(url, params)
}

// 新增员工
export const addStaff = (params) => {
  const url = '/user-management/staff-management/addStaff'
  return http.post(url, params)
}

// 新增分账人
export const addFZPerson = (params) => {
  const url = '/user-management/partner-management/insertMerchantPartner'
  return http.post(url, params)
}

// 编辑员工(重置密码)
export const editStaff = (params) => {
  const url = '/user-management/staff-management/updateStaff'
  return http.post(url, params)
}

// 编辑分账人
export const editFZPerson = (params) => {
  const url = '/user-management/partner-management/updateMerchantPartner'
  return http.post(url, params)
}

// 删除分账人
export const deleteFZPerson = (params) => {
  const url = '/user-management/partner-management/deleteMerchantPartner'
  return http.get(url, params)
}

// 分账账单
export const splitBillList = (params) => {
  const url = '/fund-management/split-management/page'
  return http.post(url, params)
}

// 删除员工
export const removeStaff = (params) => {
  const url = '/user-management/staff-management/deleteStaff'
  return http.post(url, params)
}

// 删除员工
export const removeFZPerson = (params) => {
  const url = '/user-management/partner-management/deleteMerchantPartner'
  return http.post(url, params)
}

// 获取商户所有角色类型
export const getMerchantAllRoles = (params) => {
  const url =
    '/user-management/merchant-management/merchantDetail/getMerchantAllRoles'
  return http.post(url, params)
}

// 获取商户列表导出任务id
export const exportMerchants = (params) => {
  const url = '/user-management/merchant-management/exportMerchants'
  return http.post(url, params)
}

// 获取用户列表导出任务id
export const exportUser = (params) => {
  const url = '/user-management/user-management/exportUsers'
  return http.post(url, params)
}

// 添加免费名单
export const addFreeListInfo = (params) => {
  const url = '/user-management/chargewhitelist-management/addFreeListInfo'
  return http.post(url, params)
}

// 添加内部名单
export const addInternalListInfo = (params) => {
  const url = '/user-management/chargewhitelist-management/addInternalListInfo'
  return http.post(url, params)
}

// 批量添加免费名单
export const batchAddFreeListInfo = (params) => {
  const url = '/user-management/chargewhitelist-management/batchAddFreeListInfo'
  return http.request({
    method: 'post',
    url: url,
    data: params,
    responseType: 'blob',
  })
}

// 批量添加内部名单
export const batchAddInternalListInfo = (params) => {
  const url =
    '/user-management/chargewhitelist-management/batchAddInternalListInfo'
  return http.request({
    method: 'post',
    url: url,
    data: params,
    responseType: 'blob',
  })
}

// 批量删除免费名单
export const batchDeleteFreeListInfo = (params) => {
  const url =
    '/user-management/chargewhitelist-management/batchDeleteFreeListInfo'
  return http.post(url, params)
}

// 批量删除内部名单
export const batchDeleteInternalListInfo = (params) => {
  const url =
    '/user-management/chargewhitelist-management/batchDeleteInternalListInfo'
  return http.post(url, params)
}

// 删除免费名单
export const deleteFreeListInfo = (params) => {
  const url = '/user-management/chargewhitelist-management/deleteFreeListInfo'
  return http.post(url, params)
}

// 删除内部名单
export const deleteInternalListInfo = (params) => {
  const url =
    '/user-management/chargewhitelist-management/deleteInternalListInfo'
  return http.post(url, params)
}

// 分页查询免费名单列表
export const selectFreeInfoPageList = (params) => {
  const url =
    '/user-management/chargewhitelist-management/selectFreeInfoPageList'
  return http.post(url, params)
}

// 分页查询内部名单列表
export const selectInternalInfoPageList = (params) => {
  const url =
    '/user-management/chargewhitelist-management/selectInternalInfoPageList'
  return http.post(url, params)
}

// 导出免费名单
export const exportFreeListInfo = (params) => {
  const url = '/user-management/chargewhitelist-management/exportFreeListInfo'
  return http.post(url, params)
}

// 导出内部名单
export const exportInternalListInfo = (params) => {
  const url =
    '/user-management/chargewhitelist-management/exportInternalListInfo'
  return http.post(url, params)
}

// 当前用户的所有电站列表
export const listStation = (params) => {
  const url = '/user-management/chargewhitelist-management/listStation'
  return http.post(url, params)
}

// 列出免费名单电站列表
export const listFreeStation = (params) => {
  const url = '/user-management/chargewhitelist-management/listFreeStation'
  return http.post(url, params)
}

// 列出内部名单电站列表
export const listInternalStation = (params) => {
  const url = '/user-management/chargewhitelist-management/listInternalStation'
  return http.post(url, params)
}

// 查询进件状态
export const applymentMicroGetstate = (params) => {
  const url =
    '/user-management/merchant-management/micro-merchant-applyment/applymentMicroGetstate'
  return http.post(url, params)
}

// 微信小微商户申请进件
export const applymentMicroSubmit = (params) => {
  const url =
    '/user-management/merchant-management/micro-merchant-applyment/applymentMicroSubmit'
  return http.post(url, params)
}

// 列出员工未关联电站
export const listAllStaffDontHaveStations = (params) => {
  const url =
    '/user-management/staff-management/link-station/listAllStaffDontHaveStations'
  return http.post(url, params)
}

// 列出员工已关联电站
export const listAllStaffHadStations = (params) => {
  const url =
    '/user-management/staff-management/link-station/listAllStaffHadStations'
  return http.post(url, params)
}

// 重置关联电站
export const resetStaffHadStations = (params) => {
  const url =
    '/user-management/staff-management/link-station/resetStaffHadStations'
  return http.post(url, params)
}

// 进件文件上传
// export const uploadmedia = (params) => {
//   const url = '/user-management/merchant-management/micro-merchant-applyment/uploadmedia'
//   return http.post(url, params)
// }

// todo
export const addOperator = (params) => {
  const url = '/user-management/user-management/selectUserPage'
  return http.post(url, params)
}
export const addAgent = (params) => {
  const url = '/user-management/user-management/selectUserPage'
  return http.post(url, params)
}

export const partnerList = (params) => {
  const url = `/user-management/partner-management/selectAllMerchantPartner`
  return http.get(url, params)
}
